/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Model;

import java.util.Random;

/**
 * This is the class that contains all the car data, this class is called many times during car creation.
 *
 * @author Luke
 */
public class Car {
    private String streetDir = "horizontal"; //the cars direction
    private String[] carColors = {"r", "b", "y"}; //the posible colors
    private Random randColor = new Random();
    private String carType = "cr"; //the cars direction and color info

    /**
     * Car is very basic, it is just a sting of either C or c depending on the direction passed in.
     * @param streetDir The street direction passed in, either horizontal or vertical
     */
    public Car(String streetDir){ //sets up the cars crucial values
        this.streetDir = streetDir;
        if (streetDir.equals("vertical")){
            this.carType = "c".concat(carColors[randColor.nextInt(3)]);
        } else if (streetDir.equals("horizontal")){
            this.carType = "C".concat(carColors[randColor.nextInt(3)]);
        }

    }

    @Override
    public String toString(){
        if (streetDir.equals("vertical")){
            return carType;
        } else if (streetDir.equals("horizontal")){
            return carType;
        } return " ";
    }


}
